/*
 * TJunctions_Slave.h
 *
 * Created: 6/3/2013 10:53:14 PM
 *  Author: Crossfire
 */


#ifndef TJUNCTIONS_SLAVE_H_
#define TJUNCTIONS_SLAVE_H_

#include <avr/io.h>
#include <util/delay.h>

#define TJUNCTION 0x20

int _state_1, _state_2, _delay_1, _delay_2;
uint8_t _tjunction[7][3], _byteA, _byteB, _byteC, _byteD;
unsigned char recv_data;
int _mode = 0;
uint8_t _default[7][3] =
{
{1,1,1},
{3,1,1},
{2,1,1},
{1,3,1},
{1,2,1},
{1,1,3},
{1,1,2}
};

int main(void);
void parse_data_tsplitsing();
void TWI_init_slave(void);
void TWI_read_slave(void);
void TWI_match_read_slave(void);
void set_stoplichten(int mode, int splitsing);
int get_sensors();
void set_state(int splitsing, int * state, int * delay);
#endif /* TJUNCTIONS_SLAVE_H_ */
